<?php

class Report_Form extends My_Form {
    
    function __construct($form_id) {
        My_Form::__construct($form_id);
        $this->DefaultValues = array('resource_type_id' => '',
                            'year' => '',
                            'month' => '',
                            'week' => '');
                    
        $this->init();
    }

    public function init() {
        $this->form->addDataSource(new HTML_QuickForm2_DataSource_Array($this->DefaultValues));
        
        //fieldsets or legends
        $fieldset = $this->form->addElement('fieldset')->setLabel('Report Information:');
        
        $resource_type_data = array();
        $resource_type_inventory = ResourceTypeDB::getAllResourceTypes();
        if(!is_null($resource_type_inventory))
        {
            $resource_type_inventory->rewind();
            while($resource_type_inventory->valid())
            {
                 $current_item = $resource_type_inventory->current();
                 $resource_type_data[$current_item->getResource_type_id()] = $current_item->getResource_type_name();
                 $resource_type_inventory->next();
            }
           
        }
       
       
        $resource_type_name = $fieldset->addElement('select', 'resource_type_id', null, array('options' => $resource_type_data))->setLabel('Resource:');
        $year = $fieldset->addElement('select', 'year', null, array('options' => array('2009' => '2009','2010' => '2010', '2011' => '2011', '2012'=>'2012', '2013'=>'2013', '2014'=>'2014', '2015'=>'2015', '2016'=>'2016')))->setLabel('Year:');
        $month = $fieldset->addElement('select', 'month', null, array('options' => array('January' => 'January','February' => 'February','March' => 'March','April' => 'April','May' => 'May','June' => 'June','July' => 'July','August' => 'August','September' => 'September','October' => 'October','November' => 'November','December' =>'December')))->setLabel('Month:');
        $week = $fieldset->addElement('select', 'week', null, array('options' => array( '+1 week' => 'Week 1','+2 week' => 'Week 2' , '+3 week' => 'Week 3', '+4 week' => 'Week 4')))->setLabel('Month:');
        
        $fieldset->addElement('submit', null, array('value' => 'Submit'));
        $this->form->addElement('hidden', 'action')->setValue('reports');
        
    }
    

}

?>
